
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?

$old_id = $_POST['old_id'];

 //การอัพโหลดไฟล์รูปภาพ
$student_image=$_FILES['student_image']['name'];
$size=$_FILES['student_image']['size'];
$temp=$_FILES['student_image']['tmp_name'];
$type=$_FILES['student_image']['type'];
if(file_exists($temp=$_FILES['student_image']['tmp_name']))copy($temp,"photo_member/".$student_image);

$student_id = $_POST['student_id'];
$student_prefix = $_POST['student_prefix'];
$student_name = $_POST['student_name'];
$student_surname = $_POST['student_surname'];
$student_sex = $_POST['student_sex'];
$student_birthday = $_POST['student_birthday'];
$student_email = $_POST['student_email'];
$student_add = $_POST['student_add'];
$room_id = $_POST['room_id'];

$newdata = array(
   "student_prefix"=>"$student_prefix",
   "student_name"=>"$student_name",
   "student_surname"=>"$student_surname",
   "student_sex"=>"$student_sex",
   "student_birthday"=>"$student_birthday",
   "student_email"=>"$student_email",
   "student_add"=>"$student_add",
   "room_id" => "$room_id"
);
if(file_exists($temp=$_FILES['student_image']['tmp_name'])) $newdata['student_image'] = $student_image;
			
$dbfunc->update("tb_student",$newdata,"student_id = '{$old_id}'");

echo "<center>ระบบทำการแก้ไขข้อมูลของคุณแล้วค่ะ";
echo $func->redirect("1","?module=admin&page=frm_mag_std");
?>